﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Util
{
    public class Xml
    {
        public static string getString(Object obj)
        {

            MemoryStream mem = new MemoryStream();

            XmlSerializer x = new XmlSerializer(obj.GetType());

            x.Serialize(mem, obj);

            ASCIIEncoding ascii = new ASCIIEncoding();

            string resultado = ascii.GetString(mem.ToArray());

            return resultado;

        }
    }
}